// 节点类型定义
export interface NodeData {
  id: string;
  type: string;
  name: string;
  position: {
    x: number;
    y: number;
  };
  inputs: PortData[];
  outputs: PortData[];
  properties: Record<string, any>;
}

// 端口定义
export interface PortData {
  id: string;
  name: string;
  type: string;
}

// 连接定义
export interface ConnectionData {
  id: string;
  sourceNodeId: string;
  sourcePortId: string;
  targetNodeId: string;
  targetPortId: string;
}

// 工作流定义
export interface WorkflowData {
  id: string;
  name: string;
  nodes: NodeData[];
  connections: ConnectionData[];
}

// 节点类型注册表
export interface NodeTypeRegistry {
  [key: string]: {
    name: string;
    category: string;
    inputs: PortData[];
    outputs: PortData[];
    defaultProperties: Record<string, any>;
  };
}